Skip to content

feat: add methods to flatten credential entry and set secret value#30

Merged
rbstp merged 1 commit intomasterfrom
devops/client
Dec 10, 2025
Merged

feat: add methods to flatten credential entry and set secret value#30
rbstp merged 1 commit intomasterfrom
devops/client

Conversation

@rbstp
Copy link
Contributor

@rbstp rbstp commented Dec 10, 2025

Change File Breaking? Impact
Form encoding authentication.go No Uses url.Values{} instead of fmt.Sprintf. Same output, but now properly escapes special characters in credentials. Fixes a bug with complex password since they are randomly generated.
RequestError fields dvls.go No Added StatusCode and Body fields. Existing code using Url/Err continues to work.
Error message format dvls.go Minor Error messages now include status code: "...url (status 404)...". Only affects code parsing error strings.
IsNotFound() dvls.go No New function. Additive only.
ToCredentialMap() entry_credential.go No New method on Entry. Additive only.
SetCredentialSecret() entry_credential.go No New method on Entry. Additive only.
Time parsing server.go No Now accepts MORE time formats (RFC3339Nano, etc.). Original format still supported. Fixes parsing failures.

@rbstp rbstp self-assigned this Dec 10, 2025
@rbstp rbstp requested a review from Copilot December 10, 2025 01:29
@github-actions
Copy link

🤖 You did not bump the version, a release won't be created ⚠️

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds new credential management methods and fixes several bugs in the DVLS Go SDK, including proper URL encoding for authentication credentials, enhanced error handling with status codes, and improved time parsing flexibility.

  • Adds ToCredentialMap() and SetCredentialSecret() methods to Entry for credential manipulation
  • Enhances RequestError with StatusCode and Body fields and adds IsNotFound() helper function
  • Fixes authentication to properly escape special characters in credentials using url.Values
  • Improves time parsing to support multiple RFC3339 formats

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

File Description
authentication.go Switches from string formatting to url.Values for proper credential encoding, fixing bugs with special characters in passwords
dvls.go Adds StatusCode and Body fields to RequestError, implements IsNotFound() helper, improves error messages with status codes, and fixes defer placement for response body closure
entry_credential.go Adds ToCredentialMap() to flatten credential entries into maps and SetCredentialSecret() to update secret values
server.go Replaces single time format with multiple fallback formats (RFC3339Nano, etc.) for more robust time parsing

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@rbstp rbstp merged commit ab3b848 into master Dec 10, 2025
1 check passed
@rbstp rbstp deleted the devops/client branch December 10, 2025 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants